package org.dyyx.nrest.rest.mapping;

import java.lang.reflect.Method;

import org.dyyx.nrest.annotation.PatchMapping;


public final class PatchMappingRegisterStrategy extends AbstractRequestMappingRegisterStrategy implements RequestMappingRegisterStrategy {
    
  
    @Override
    public String getMethodUrl(Method method) {
        if(method.getAnnotation(PatchMapping.class) != null) {
            return method.getAnnotation(PatchMapping.class).value();
        }
        return "";
    }

 
    @Override
    public String getHttpMethod() {
        return "PATCH";
    }

    @Override
    public void registerMapping(String url, ControllerMapping mapping) {
        ControllerMappingRegistry.getPatchMappings().put(url, mapping);
    }

}
